package com.yyq.adms.usermanage.pojo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "ss_sys_online_users")
public class SysOnlineUsers implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2265534740068269828L;
	private Long userId;
	private String username;
	private Integer onlinests;
	private String ip;
	private String machinename;

	@Id
	@GeneratedValue(generator = "c-assigned") 
	@GenericGenerator(name = "c-assigned", strategy = "assigned")
	@Column(name = "user_id", nullable = false)
	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	@Column(name = "user_name", nullable = false)
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
	@Column(name = "online_sts", nullable = false)
	public Integer getOnlinests() {
		return onlinests;
	}
	public void setOnlinests(Integer onlinests) {
		this.onlinests = onlinests;
	}
	
	@Column(name = "ip")
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	@Column(name = "machine_name")
	public String getMachinename() {
		return machinename;
	}
	public void setMachinename(String machinename) {
		this.machinename = machinename;
	}

	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append("\r\n在线用户ID="+this.userId);
		str.append("\r\n;在线用户名称="+this.username);
		str.append("\r\n;在线用户IP="+this.ip);
		str.append("\r\n;在线用户状态="+this.onlinests);
		str.append("\r\n;在线用户机器名称="+this.machinename);
		return str.toString();
	}
}
